<html>
<head>
	<resource:autoComplete skin="default" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
    <g:set var="entityName" value="${message(code: 'integrante.label', default: 'Integrante')}" />
    <title>Experi&ecirc;ncias</title>
</head>
<body>
	<g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
    </g:if>
  <h1>Experi&ecirc;ncias</h1>
  <g:if test="${(!session.usuario && !veioDoForm) || !integranteInstance}">
  		Escolha um integrante     
       <g:form action="experienciasPassadas" method="post">
           <table border="0" style="width: 350px;">
           
           <tr>
              <td style="text-align: right;">Integrante</td>
              <td><richui:autoComplete name="integrante" controller="integrante" action="pegarIntegrante" maxResultsDisplayed="5"/></td>
           </tr>

 			<tr>
            <td colspan="2" style="text-align: center;">
            <input id="pesquisar" name="pesquisar" type="submit" value="Pesquisar" class="botao"></td>
            </tr>
          </table>
        </g:form>
        
   </g:if>
   <g:else>
		<g:each in="${integranteInstance.equipesQueCoordena()}" var="equipe">
			<g:link controller="equipe" action="show" id="${equipe.id}">Coordenou a Equipe: ${equipe.nome.encodeAsHTML()} (${equipe.encontro.tema})</g:link><br />
		</g:each>
		
		<g:each in="${integranteInstance.circulosQueCoordena()}" var="circulo">
			<g:link controller="circulo" action="show" id="${circulo.id}">Coordenou o C&iacute;rculo: ${circulo.nome.encodeAsHTML()} (${circulo.encontro.tema})</g:link><br />
		</g:each>
				
		<g:each in="${integranteInstance.equipesQueEhMembro()}" var="equipe">
			<g:link controller="equipe" action="show" id="${equipe.id}">Integrou a Equipe: ${equipe.nome.encodeAsHTML()} (${equipe.encontro.tema})</g:link><br />
		</g:each>
				
		<g:each in="${integranteInstance.circulosQueEhMembro()}" var="circulo">
			<g:link controller="circulo" action="show" id="${circulo.id}">Integrou o C&iacute;rculo: ${circulo.nome.encodeAsHTML()} (${circulo.encontro.tema})</g:link><br />
		</g:each>
   </g:else>
</body>